import java.util.HashSet;
import java.util.Set;

/**
 * @USER: Administrator
 * @DATE: 2024/9/22 上午9:06
 * @VERSION: 1.0.0
 */
public class LC3289 {
    public int[] getSneakyNumbers(int[] nums) {
        int[] result = new int[2];
        Set<Integer> set = new HashSet<>();
        int count = 0;
        for (int num : nums) {
            if (!set.add(num)) {
                result[count++] = num;
            }
            if (count == result.length) {
                break;
            }
        }

        return result;
    }
}
